package com.personal.mall.member;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

/**
 *   ##调用远程服务步骤
 *      1、引入openfeign依赖
 *      2、在需要调用远程服务的启动类加上注解 @EnableFeignClients(basePackage="扫描远程接口所在包")
 *      3、编写远程接口
 *      4、创建feign包用于将所有远程调用的接口放于此包下
 *      5、将远程接口复制进本地feign下的service中(注意本地接口调用远程接口要写远程接口的地址全名)
 *          例如接口请求地址是member/coupon
 *          但是要加上controller的请求地址 coupon/coupon
 *          所以得出 coupon/coupon/member/coupon
 *
 */

@EnableFeignClients(basePackages = "com.personal.mall.member.feign")
@SpringBootApplication
@EnableDiscoveryClient //将自己注册进nacos
public class MallMemberApplication {

    public static void main(String[] args) {
        SpringApplication.run(MallMemberApplication.class, args);
    }

}
